<?php
include_once XOOPS_ROOT_PATH."/class/template.php";
	$XoopsTpl = new XoopsTpl();

function neoobject_admin_imagecat_main(){
	global $XoopsTpl;
	$imagecategoryH = & xoops_gethandler("imagecategory");
	$imagecatH = & xoops_getmodulehandler("imagecat");

	xoops_cp_header();
	echo $XoopsTpl->fetch('db:neoobject_admin_mainmenu.html');
		$imagecatO = $imagecatH->create();

		$imagecatO->xoopsimagecats = & $imagecategoryH->getObjects(null,1);

		$XoopsTpl->assign_by_ref("imagecatO",$imagecatO);
		$XoopsTpl->assign_by_ref("imagecats",$imagecatH->getObjects());
		echo $XoopsTpl->fetch("db:neoobject_admin_imagecat_main.html");
	
	xoops_cp_footer();
}
function neoobject_admin_imagecat_create_ok(){
	#$imagecatH
	#print_r($_POST);

	$imagecatH = & xoops_getmodulehandler("imagecat");
	$imagecatO = $imagecatH->create();
	$imagecatO->setFormVars($_POST,'imagecat_');
	$imagecatH->insert($imagecatO);
	
	redirect_header("index.php?type=imagecat");
	exit();
}


function neoobject_admin_imagecat_edit(){
	global $XoopsTpl;
	$imagecategoryH = & xoops_gethandler("imagecategory");
	xoops_cp_header();
	echo $XoopsTpl->fetch('db:neoobject_admin_mainmenu.html');
	$imagecatH = & xoops_getmodulehandler("imagecat");
	$imagecatO = $imagecatH->get($_GET['id']);
	$imagecatO->xoopsimagecats = & $imagecategoryH->getObjects(null,1);
	$XoopsTpl->assign_by_ref("imagecatO",$imagecatO);
	echo $XoopsTpl->fetch("db:neoobject_admin_imagecat_edit.html");
	xoops_cp_footer();

	
}
function neoobject_admin_imagecat_edit_ok(){
	$imagecatH = & xoops_getmodulehandler("imagecat");
	$imagecatO = $imagecatH->get($_GET['id']);
	$imagecatO->setFormVars($_POST,"imagecat_");
	$imagecatH->insert($imagecatO);		
		redirect_header("index.php?type=imagecat");
		exit();

}
function neoobject_admin_imagecat_delete_ok(){
	$imagecatH = & xoops_getmodulehandler("imagecat");
	$imagecatO = $imagecatH->get($_GET['id']);
	$imagecatH->delete($imagecatO);
		redirect_header("index.php?type=imagecat");
		exit();

}

?>


